// ImageData.h : Implementation of the CImageData class



// CImageData implementation

// code generated on 10 May 2007, 15:02

#include "stdafx.h"
#include "ImageData.h"
IMPLEMENT_DYNAMIC(CImageData, CRecordset)

CImageData::CImageData(CDatabase* pdb)
	: CRecordset(pdb)
{
	m_ImageName = "";
	m_PaperID = "";
	m_Caption = "";
	m_Reference = "";
	m_Title = "";
	m_Fulltext1 = "";
	m_Fulltext2 = "";
	m_Fulltext3 = "";
	m_Fulltext4 = "";
	m_Journal = "";
	m_Authors = "";
	m_Year = 0;
	m_ColourFeature = "";
	m_ShapeFeature = "";
	m_TextureFeature = "";
	m_TextFeatureCaption = "";
	m_TextFeatureReference = "";
	m_ImageContent;
	m_FileFormat = "";
	m_IsCutted = FALSE;
	m_IsTraining = FALSE;
	m_nFields = 21;
	m_nDefaultType = dynaset;
}

CString CImageData::GetDefaultConnect()
{
	return _T("DSN=imageData;Description=Connecting to the cell image database;UID=Administrator;APP=Microsoft\x00ae Visual Studio\x00ae 2005;WSID=D4FN7F2J;DATABASE=ImageCell;LANGUAGE=us_english;Network=DBMSSOCN;Address=134.226.38.17,1999");
}

CString CImageData::GetDefaultSQL()
{
	return _T("[dbo].[ImageIndex]");
}

void CImageData::DoFieldExchange(CFieldExchange* pFX)
{
	pFX->SetFieldType(CFieldExchange::outputColumn);
// Macros such as RFX_Text() and RFX_Int() are dependent on the
// type of the member variable, not the type of the field in the database.
// ODBC will try to automatically convert the column value to the requested type
	RFX_Text(pFX, _T("[ImageName]"), m_ImageName, 255);
	RFX_Text(pFX, _T("[PaperID]"), m_PaperID, 255);
	RFX_Text(pFX, _T("[Caption]"), m_Caption, SHRT_MAX);
	RFX_Text(pFX, _T("[Reference]"), m_Reference, SHRT_MAX);
	RFX_Text(pFX, _T("[Title]"), m_Title, 899);
	RFX_Text(pFX, _T("[Fulltext1]"), m_Fulltext1, SHRT_MAX);
	RFX_Text(pFX, _T("[Fulltext2]"), m_Fulltext2, SHRT_MAX);
	RFX_Text(pFX, _T("[Fulltext3]"), m_Fulltext3, SHRT_MAX);
	RFX_Text(pFX, _T("[Fulltext4]"), m_Fulltext4, SHRT_MAX);
	RFX_Text(pFX, _T("[Journal]"), m_Journal, 255);
	RFX_Text(pFX, _T("[Authors]"), m_Authors, 899);
	RFX_Long(pFX, _T("[Year]"), m_Year);
	RFX_Text(pFX, _T("[ColourFeature]"), m_ColourFeature, SHRT_MAX);
	RFX_Text(pFX, _T("[ShapeFeature]"), m_ShapeFeature, SHRT_MAX);
	RFX_Text(pFX, _T("[TextureFeature]"), m_TextureFeature, SHRT_MAX);
	RFX_Text(pFX, _T("[TextFeatureCaption]"), m_TextFeatureCaption, SHRT_MAX);
	RFX_Text(pFX, _T("[TextFeatureReference]"), m_TextFeatureReference, SHRT_MAX);
	RFX_LongBinary(pFX, _T("[ImageContent]"), m_ImageContent);
	RFX_Text(pFX, _T("[FileFormat]"), m_FileFormat, SHRT_MAX);
	RFX_Bool(pFX, _T("[IsCutted]"), m_IsCutted);
	RFX_Bool(pFX, _T("[IsTraining]"), m_IsTraining);

}
/////////////////////////////////////////////////////////////////////////////
// CImageData diagnostics

#ifdef _DEBUG
void CImageData::AssertValid() const
{
	CRecordset::AssertValid();
}

void CImageData::Dump(CDumpContext& dc) const
{
	CRecordset::Dump(dc);
}
#endif //_DEBUG


